home *** CD-ROM | disk | FTP | other *** search
/ Megarom / Megarom Macintosh CD Software (Quantum Leap)(1992).iso / COMMUNICATION / BBS Software Systems / Hermes ƒ / HEI 1.0.7 / UpdatePhone.p < prev    next >
Text File  |  1990-12-31  |  3KB  |  105 lines

  1. unit UpdPhoneExt;
  2.  
  3. interface
  4.     uses
  5.         HermHeaders;
  6.  
  7.     procedure MAIN (HermSetup: UserXIPtr);
  8.  
  9. implementation
  10.  
  11.     procedure MAIN (HermSetup: UserXIPtr);
  12.         var
  13.             i: integer;
  14.             t1: str255;
  15.     begin
  16.         with HermSetup^ do
  17.             begin
  18.                 if message <> closeExternal then
  19.                     begin
  20.                         if privates = nil then  {never been called before}
  21.                             begin
  22.                                 privates := myPrivsHand(NewHandle(SizeOf(myPrivs)));
  23.                                 MoveHHi(handle(privates));
  24.                                 HNoPurge(handle(privates));
  25.                                 for i := 1 to 10 do
  26.                                     begin
  27.                                         privates^^.activeOn[i] := false;
  28.                                         privates^^.stage[i] := 0;
  29.                                     end;
  30.                             end;
  31.                         if not privates^^.activeOn[curNode^] then
  32.                             begin
  33.                                 privates^^.activeOn[curNode^] := true;
  34.                                 privates^^.stage[curNode^] := 1;
  35.                             end;
  36.                     end;
  37.                 case message of
  38.                     closeExternal: 
  39.                         begin
  40.                             if privates <> nil then
  41.                                 begin
  42.                                     HPurge(handle(privates));
  43.                                     DisposHandle(handle(privates));
  44.                                     privates := nil;
  45.                                 end;
  46.                         end;
  47.                     closeNode: 
  48.                         begin
  49.                             privates^^.activeOn[curNode^] := false;
  50.                             privates^^.stage[curNode^] := 0;
  51.                         end;
  52.                     activeExt: 
  53.                         begin
  54.                             case privates^^.stage[curNode^] of
  55.                                 1: 
  56.                                     begin
  57.                                         bCR(procs[0]);
  58.                                         OutLine('Your current phone number is:', true, 0, procs[1]);
  59.                                         OutLine(n[curNode^]^.thisUser.phone, true, 0, procs[1]);
  60.                                         bCR(procs[0]);
  61.                                         bCR(procs[0]);
  62.                                         YesNoQuestion('Do you wish to change it? ', false, procs[6]);
  63.                                         privates^^.stage[curNode^] := 2;
  64.                                     end;
  65.                                 2: 
  66.                                     begin
  67.                                         if n[curNode^]^.curPrompt = 'Y' then
  68.                                             begin
  69.                                                 OutLine('Enter new number.', true, 0, procs[1]);
  70.                                                 bCR(procs[0]);
  71.                                                 LettersPrompt(': ', '', 12, false, false, true, char(0), procs[4]);
  72.                                                 privates^^.stage[curNode^] := 3;
  73.                                             end
  74.                                         else
  75.                                             begin
  76.                                                 privates^^.activeOn[curNode^] := false;
  77.                                                 privates^^.stage[curNode^] := 0;
  78.                                                 n[curNode^]^.activeuserExternal := -1;
  79.                                             end;
  80.                                     end;
  81.                                 3: 
  82.                                     begin
  83.                                         t1 := n[curNode^]^.curPrompt;
  84.                                         if ((length(t1) = 12) and (t1[4] = '-') and (t1[8] = '-')) or (HSystPtr^.freePhone and (length(t1) > 9)) then
  85.                                             begin
  86.                                                 n[curNode^]^.thisUser.phone := t1;
  87.                                                 OutLine('Your phone number has been updated.', true, 0, procs[1]);
  88.                                             end
  89.                                         else
  90.                                             begin
  91.                                                 OutLine('Number not changed, format invalid.', true, 0, procs[1]);
  92.                                             end;
  93.                                         privates^^.activeOn[curNode^] := false;
  94.                                         privates^^.stage[curNode^] := 0;
  95.                                         n[curNode^]^.activeuserExternal := -1;
  96.                                     end;
  97.                                 otherwise
  98.                             end;
  99.                         end;
  100.                     otherwise
  101.                 end;
  102.             end;
  103.     end;
  104.  
  105. end.